﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using tuwien.auto.eibclient;

namespace KNXFramework.KNXObjects.ValueObjects.Unsigned
{
    internal class HeatingModeObjectValue : U8ObjectValue
    {
        public HeatingModeObjectValue(string value)
        {
            switch (value.ToLower())
            {
                case "comfort":
                    m_Value = 1;
                    break;
                case "standby":
                    m_Value = 2;
                    break;
                case "night":
                    m_Value = 3;
                    break;
                case "frost":
                    m_Value = 4;
                    break;
                default:
                    throw new ApplicationException("HeatingModeObjectValue: Bad value: " + value);
            }
        }
        public HeatingModeObjectValue(EIBBuffer buffer) : base(buffer)
        {

        }
        public override string ToString()
        {
            switch (m_Value)
            {
                case 1:
                    return "comfort";                    
                case 2:
                    return "standby";
                case 3:
                    return "night";
                case 4:
                    return "frost";
                default:
                    return "frost";
            }
        }
    }
}
